package com.lite.business.service.commodities;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lite.business.entity.commodities.Commodities;
import com.lite.business.entity.commodities.CommodityQueryWrapper;
import com.lite.business.exception.BusinessException;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author stranger
 * @since 2022-10-25
 */
public interface CommoditiesService extends IService<Commodities> {

    /**
     * 读取一个商品的信息
     */
    Commodities getCommodityById(Integer cmodId) throws BusinessException;

    /**
     * 分页读取商品信息列表
     */
    List<Commodities> listCommoditiesByPage(Integer page, Integer size, CommodityQueryWrapper commodityQueryWrapper);

    /**
     * 修改一个商品的信息
     */
    Boolean updateCommoditiesById(Integer cmodId, Commodities newCommodity) throws BusinessException;

    /**
     * 删除一个商品
     */
    Boolean removeCommoditiesById(Integer cmodId) throws BusinessException;

    /**
     * 新增一个商品
     */
    Boolean addCommodities(Commodities commodities) throws BusinessException;
}
